class C{
    public int a;
    String name;
    public int sum(int a,int b,int c){
        return a+b+c;
    }
}
class D extends C{
    public int c;
    @Override//注解显示指定
    //这里就是对D类的重写。快捷键；generate->override methods
    public int sum(int a, int b, int c) {
        return super.sum(a, b, c);
    }
}
public class Test1 {
    public static void main(String[] args) {
        D d = new D();
        int sum = d.sum(10, 11, 12);//调用父类的方法
        System.out.println(sum);
    }
}
    /*
class A {
    public int c;
    public int d;

    public int fun(int a, int b) {//1
        return a + b;
    }

    public double fun(double a, double c) {//2
        return a * c;
    }
}

class B {
    public int a;
    public int b;

    public int fun(int a, int b, int c) {//3
        return a + b + c;
    }
}
/*
    public static void main2(String[] args){
        A a=new A();
        int c1 = a.fun(2, 3);
        System.out.print(c1+" ");
        int c2 = a.fun(2, 3);
        System.out.print(c2+" ");
        B b = new B();
        int c3 = b.fun(2, 3, 4);
        System.out.print(c3);
    }
    //final public class A{
       // String a;//我们平常用的string字符串就是final修饰的
   // }
    //class B extends A{//这里报错

    //}
    public static void main1(String[] args) {
        final int a=10;
        //a=20;//这里报错了，
        //final修饰变量或字段，表示常量，只能初始化一次，且初始化后不能被修改
    }
}

 */
